In recent years, semiconductor devices mounted with nonvolatile memories have been used in a variety of fields. Specifically, microcontrollers mounted with nonvolatile memories such as flash memories, for example, have been used in various kinds of household electrical appliances and information apparatus or in automobile control systems and the like.
In the flash memory of a microcontroller, for example, information such as a program for controlling the microcontroller is written by a system manufacturer, and to protect the information written in the flash memory against illegal access from a malicious third party, security technology has been developed.
On the other hand, when an unexpected fault occurs in the microcontroller, it is common practice for the microcontroller manufacturer to analyze the cause of the fault, for example, by examining the information written in the flash memory mounted on the microcontroller.
Microcontrollers mounted with the type of nonvolatile memory to which security technology is applied, as described above, have been proposed in the related art, but in this type of memory, once the security is set ON, no other operation than a total erasure (chip erase) is allowed on the nonvolatile memory.
There may also arise cases where a certain kind of fault (failure) occurs, for example, when the end user is using a microcontroller-equipped product in the field, and the microcontroller is returned to the system manufacturer and then to the microcontroller manufacturer for analysis of the fault.
Here, if the fault is, for example, of the type that occurs when the program stored in the nonvolatile memory is executed but that is unable to be checked once a chip erase of the nonvolatile memory is done, it is not possible to analyze the fault at the microcontroller manufacturer.
That is, in the case of a microcontroller incorporating a nonvolatile memory equipped with the security function according to the related art, since no other operation than a chip erase is allowed on the nonvolatile memory once the security is set ON, the microcontroller manufacturer is unable to check the fault condition.
On the other hand, in the case of a microcontroller incorporating a nonvolatile memory not equipped with such a security function, it is possible to analyze the fault at the microcontroller manufacturer, but the system manufacturer tends to avoid using such a microcontroller because of its inability to provide protection against illegal access from a malicious third party.
In the related art, there have been proposed various kinds of microcontrollers mounted with nonvolatile memories to which security technology is applied.    Patent Document 1: Japanese Laid-open Patent Publication No. H10-301855    Patent Document 2: Japanese Laid-open Patent Publication No. 2004-227509    Patent Document 3: Japanese Laid-open Patent Publication No. 2003-263368    Patent Document 4: Japanese Laid-open Patent Publication No. H07-271751    Patent Document 5: Japanese Laid-open Patent Publication No. H09-198316    Patent Document 6: Japanese Laid-open Patent Publication No. 2004-288257